home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / dev / lang / amigatalk.lha / intuition / IconTags.st < prev    next >
Text File  |  2002-03-15  |  13KB  |  333 lines

  1. " -------------------------------------------------------------------- "
  2. " IconTypeTags Class allows the User to reference icon types used by   "
  3. " various Icon methods as Symbols.                                     "
  4. ""
  5. " The User does NOT need to create one of these, since Intuition Class "
  6. " will instantiate the only needed instance of this Class.  See the    "
  7. " SetupIntuition.st source file for the method(s) that help the User   "
  8. " with this Class.                                                     "
  9. "" 
  10. "   EXAMPLE:  'myTag <- intuition getIcontTypeTag: #WBDISK'            "
  11. ""
  12. " ALL singleton classes MUST contain the following:                    "
  13. ""
  14. "   the methods:  isSingleton AND privateSetup     AND                 "
  15. "                 uniqueInstance Class instance variable.              "
  16. " -------------------------------------------------------------------- "
  17.  
  18. Class IconTypeTags :Dictionary ! uniqueInstance !
  19. [
  20.    isSingleton
  21.      ^ true  
  22. |  
  23.    privateNew ! newinstance !
  24.      newinstance <- super new.
  25.  
  26.      ^ newinstance
  27. |
  28.    new
  29.      ^ self privateSetup
  30. |
  31.    privateInitializeDictionary
  32.  
  33.      self at: #WBDISK    put: 1.
  34.      self at: #WBDRAWER  put: 2.
  35.      self at: #WBTOOL    put: 3.
  36.      self at: #WBPROJECT put: 4.
  37.      self at: #WBGARBAGE put: 5.
  38.      self at: #WBDEVICE  put: 6.
  39.      self at: #WBKICK    put: 7.
  40.      self at: #WBAPPICON put: 8.
  41. |
  42.    privateSetup
  43.      (uniqueInstance isNil)
  44.        ifTrue: [uniqueInstance <- self privateNew.
  45.  
  46.                 self privateInitializeDictionary
  47.                ].
  48.                
  49.      ^ self    "or ^ uniqueInstance??"
  50. ]
  51.  
  52. " -------------------------------------------------------------------- "
  53. " IconTags Class allows the User to reference icon tags used by        "
  54. " various Icon methods as Symbols.                                     "
  55. ""
  56. " The User does NOT need to create one of these, since Intuition Class "
  57. " will instantiate the only needed instance of this Class.  See the    "
  58. " SetupIntuition.st source file for the method(s) that help the User   "
  59. " with this Class.                                                     "
  60. "" 
  61. "   EXAMPLE:  'myTag <- intuition getIcontTag: #ICONCTRLA_SetWidth'    "
  62. ""
  63. " ALL singleton classes MUST contain the following:                    "
  64. ""
  65. "   the methods:  isSingleton AND privateSetup     AND                 "
  66. "                 uniqueInstance Class instance variable.              "
  67. " -------------------------------------------------------------------- "
  68.  
  69. Class IconTags :Dictionary ! uniqueInstance !
  70. [
  71.    isSingleton
  72.      ^ true  
  73. |  
  74.    privateNew ! newinstance !
  75.      newinstance <- super new.
  76.  
  77.      ^ newinstance
  78. |
  79.    new
  80.      ^ self privateSetup
  81. |
  82.    privateInitializeDictionary
  83.  
  84.      " Error reporting (Integer): "
  85.      self at: #ICONA_ErrorCode                     put: 16r80009001.
  86.  
  87.      " Points to the tag item that caused the error (struct TagItem **). "
  88.      self at: #ICONA_ErrorTagItem                  put: 16r8000904B.
  89.  
  90.      " Global options for IconControlA(): ----------------------------- "
  91.  
  92.      " Screen to use for remapping Workbench icons to (ScreenObj): "
  93.      self at: #ICONCTRLA_SetGlobalScreen           put: 16r80009002.
  94.      self at: #ICONCTRLA_GetGlobalScreen           put: 16r80009003.
  95.  
  96.      " Icon color remapping precision; defaults to PRECISION_ICON (Integer) "
  97.      self at: #ICONCTRLA_SetGlobalPrecision        put: 16r80009004.
  98.      self at: #ICONCTRLA_GetGlobalPrecision        put: 16r80009005.
  99.  
  100.      " Icon frame size dimensions (RectangleObj): "
  101.      self at: #ICONCTRLA_SetGlobalEmbossRect       put: 16r80009006.
  102.      self at: #ICONCTRLA_GetGlobalEmbossRect       put: 16r80009007.
  103.  
  104.      " Render image without frame (Boolean): "
  105.      self at: #ICONCTRLA_SetGlobalFrameless        put: 16r80009008.
  106.      self at: #ICONCTRLA_GetGlobalFrameless        put: 16r80009009.
  107.  
  108.      " Enable NewIcons support (Boolean): "
  109.      self at: #ICONCTRLA_SetGlobalNewIconsSupport  put: 16r8000900A.
  110.      self at: #ICONCTRLA_GetGlobalNewIconsSupport  put: 16r8000900B.
  111.  
  112.      " Enable color icon support (Boolean) "
  113.      self at: #ICONCTRLA_SetGlobalColorIconSupport put: 16r8000904D.
  114.      self at: #ICONCTRLA_GetGlobalColorIconSupport put: 16r8000904E.
  115.  
  116.      " Set/Get the hook to be called when identifying a file (HookObj) "
  117.      self at: #ICONCTRLA_SetGlobalIdentifyHook     put: 16r8000900C.
  118.      self at: #ICONCTRLA_GetGlobalIdentifyHook     put: 16r8000900D.
  119.  
  120.      " Set/get the maximum length of a file/drawer name supported
  121.      * by icon.library (Integer).
  122.      "
  123.      self at: #ICONCTRLA_SetGlobalMaxNameLength    put: 16r80009043.
  124.      self at: #ICONCTRLA_GetGlobalMaxNameLength    put: 16r80009044.
  125.  
  126.      " Per icon local options for IconControlA(): --------------------- "
  127.  
  128.      " Get the icon rendering masks (PLANEPTR) "
  129.      self at: #ICONCTRLA_GetImageMask1 put: 16r8000900E.
  130.      self at: #ICONCTRLA_GetImageMask2 put: 16r8000900F.
  131.  
  132.      " Transparent image color; set to -1 if opaque "
  133.      self at: #ICONCTRLA_SetTransparentColor1 put: 16r80009010.
  134.      self at: #ICONCTRLA_GetTransparentColor1 put: 16r80009011.
  135.      self at: #ICONCTRLA_SetTransparentColor2 put: 16r80009012.
  136.      self at: #ICONCTRLA_GetTransparentColor2 put: 16r80009013.
  137.  
  138.      " Image color palette (struct ColorRegister *) "
  139.      self at: #ICONCTRLA_SetPalette1          put: 16r80009014.
  140.      self at: #ICONCTRLA_GetPalette1          put: 16r80009015.
  141.      self at: #ICONCTRLA_SetPalette2          put: 16r80009016.
  142.      self at: #ICONCTRLA_GetPalette2          put: 16r80009017.
  143.  
  144.      " Size of image color palette (Integer) "
  145.      self at: #ICONCTRLA_SetPaletteSize1      put: 16r80009018.
  146.      self at: #ICONCTRLA_GetPaletteSize1      put: 16r80009019.
  147.      self at: #ICONCTRLA_SetPaletteSize2      put: 16r8000901A.
  148.      self at: #ICONCTRLA_GetPaletteSize2      put: 16r8000901B.
  149.  
  150.      " Image data; one by per pixel (String) "
  151.      self at: #ICONCTRLA_SetImageData1        put: 16r8000901C.
  152.      self at: #ICONCTRLA_GetImageData1        put: 16r8000901D.
  153.      self at: #ICONCTRLA_SetImageData2        put: 16r8000901E.
  154.      self at: #ICONCTRLA_GetImageData2        put: 16r8000901F.
  155.  
  156.      " Render image without frame (Boolean) "
  157.      self at: #ICONCTRLA_SetFrameless         put: 16r80009020.
  158.      self at: #ICONCTRLA_GetFrameless         put: 16r80009021.
  159.  
  160.      " Enable NewIcons support (Boolean) "
  161.      self at: #ICONCTRLA_SetNewIconsSupport   put: 16r80009022.
  162.      self at: #ICONCTRLA_GetNewIconsSupport   put: 16r80009023.
  163.  
  164.      " Icon aspect ratio (String) "
  165.      self at: #ICONCTRLA_SetAspectRatio       put: 16r80009024.
  166.      self at: #ICONCTRLA_GetAspectRatio       put: 16r80009025.
  167.  
  168.      " Icon dimensions; valid only for palette mapped icon images (LONG) "
  169.      self at: #ICONCTRLA_SetWidth             put: 16r80009026.
  170.      self at: #ICONCTRLA_GetWidth             put: 16r80009027.
  171.      self at: #ICONCTRLA_SetHeight            put: 16r80009028.
  172.      self at: #ICONCTRLA_GetHeight            put: 16r80009029.
  173.  
  174.      " Check whether the icon is palette mapped (Integer). "
  175.      self at: #ICONCTRLA_IsPaletteMapped      put: 16r8000902A.
  176.  
  177.      " Get the screen the icon is attached to (ScreenObj). "
  178.      self at: #ICONCTRLA_GetScreen            put: 16r8000902B.
  179.  
  180.      " Check whether the icon has a real select image (Integer). "
  181.      self at: #ICONCTRLA_HasRealImage2        put: 16r8000902C.
  182.  
  183.      " Check whether the icon is of the NewIcon type (iconObj). "
  184.      self at: #ICONCTRLA_IsNewIcon            put: 16r8000904F.
  185.  
  186.      " Check whether this icon was allocated by icon.library
  187.      * or if consists solely of a statically allocated
  188.      * struct DiskObject. (LONG *).
  189.      "
  190.      self at: #ICONCTRLA_IsNativeIcon         put: 16r80009050.
  191.  
  192.      " Icon aspect ratio is not known. "
  193.      self at: #ICON_ASPECT_RATIO_UNKNOWN      put: 0.
  194.  
  195.      " Tags for use with GetIconTagList(): ---------------------------- "
  196.  
  197.      " Default icon type to retrieve (LONG) "
  198.      self at: #ICONGETA_GetDefaultType        put: 16r8000902D.
  199.  
  200.      " Retrieve default icon for the given name (String) "
  201.      self at: #ICONGETA_GetDefaultName        put: 16r8000902E.
  202.  
  203.      " Return a default icon if the req'd icon file cannot be found (Boolean).
  204.      "
  205.      self at: #ICONGETA_FailIfUnavailable     put: 16r8000902F.
  206.  
  207.      " If possible, retrieve a palette mapped icon (Boolean). "
  208.      self at: #ICONGETA_GetPaletteMappedIcon  put: 16r80009030.
  209.  
  210.      " Set if the icon returned is a default icon (BOOL *). "
  211.      self at: #ICONGETA_IsDefaultIcon         put: 16r80009031.
  212.  
  213.      " Remap the icon to the default screen, if possible (Boolean). "
  214.      self at: #ICONGETA_RemapIcon             put: 16r80009032.
  215.  
  216.      " Generate icon image masks (Boolean). "
  217.      self at: #ICONGETA_GenerateImageMasks    put: 16r80009033.
  218.  
  219.      " Label text to be assigned to the icon (String). "
  220.      self at: #ICONGETA_Label                 put: 16r80009034.
  221.  
  222.      " Screen to remap the icon to (struct Screen *). "
  223.      self at: #ICONGETA_Screen                put: 16r80009045.
  224.  
  225.      " Tags for use with PutIconTagList(): ---------------------------- "
  226.  
  227.      " Notify Workbench of the icon being written (Boolean) "
  228.      self at: #ICONPUTA_NotifyWorkbench       put: 16r80009035.
  229.  
  230.      " Store icon as the default for this type (LONG) "
  231.      self at: #ICONPUTA_PutDefaultType        put: 16r80009036.
  232.  
  233.      " Store icon as a default for the given name (String) "
  234.      self at: #ICONPUTA_PutDefaultName        put: 16r80009037.
  235.  
  236.      " When storing a palette mapped icon, don't save the
  237.      * the original planar icon image with the file. Replace
  238.      * it with a tiny replacement image.
  239.      "
  240.      self at: #ICONPUTA_DropPlanarIconImage   put: 16r80009038.
  241.  
  242.      " Don't write the chunky icon image data to disk. "
  243.      self at: #ICONPUTA_DropChunkyIconImage   put: 16r80009039.
  244.  
  245.      " Don't write the NewIcons tool types to disk. "
  246.      self at: #ICONPUTA_DropNewIconToolTypes  put: 16r8000903A.
  247.  
  248.      " If this tag is enabled, the writer will examine the icon image 
  249.      * data to find out whether it can compress it more efficiently. 
  250.      * This may take extra time and is not generally recommended.
  251.      "
  252.      self at: #ICONPUTA_OptimizeImageSpace    put: 16r8000903B.
  253.  
  254.      " Don't write the entire icon file back to disk, only change 
  255.      * the do->do_CurrentX/do->do_CurrentY members.
  256.      "
  257.      self at: #ICONPUTA_OnlyUpdatePosition    put: 16r80009048.
  258.  
  259.      " Before writing a palette mapped icon back to disk,
  260.      * icon.library will make sure that the original
  261.      * planar image data is stored in the file. If you
  262.      * don't want that to happen, set this option to
  263.      * FALSE. This will allow you to change the planar icon
  264.      * image data written back to disk.
  265.      "
  266.      self at: #ICONPUTA_PreserveOldIconImages put: 16r80009054.
  267.  
  268.      " Tags for use with DupDiskObjectA(): -------------------------- "
  269.  
  270.      " Duplicate do_DrawerData "
  271.      self at: #ICONDUPA_DuplicateDrawerData   put: 16r8000903C.
  272.  
  273.      " Duplicate the Image structures. "
  274.      self at: #ICONDUPA_DuplicateImages       put: 16r8000903D.
  275.  
  276.      " Duplicate the image data (Image->ImageData) itself. "
  277.      self at: #ICONDUPA_DuplicateImageData    put: 16r8000903E.
  278.  
  279.      " Duplicate the default tool. "
  280.      self at: #ICONDUPA_DuplicateDefaultTool  put: 16r8000903F.
  281.  
  282.      " Duplicate the tool types list. "
  283.      self at: #ICONDUPA_DuplicateToolTypes    put: 16r80009040.
  284.  
  285.      " Duplicate the tool window. "
  286.      self at: #ICONDUPA_DuplicateToolWindow   put: 16r80009041.
  287.  
  288.      " If the icon to be duplicated is in fact a palette mapped
  289.       * icon which has never been set up to be displayed on the
  290.       * screen, turn the duplicate into that palette mapped icon.
  291.       "
  292.      self at: #ICONDUPA_ActivateImageData     put: 16r80009052.
  293.  
  294.      " Tags for use with DrawIconStateA() and GetIconRectangleA(). "
  295.  
  296.      " Drawing information to use (struct DrawInfo *). "
  297.      self at: #ICONDRAWA_DrawInfo             put: 16r80009042.
  298.  
  299.      " Draw the icon without the surrounding frame (Boolean). "
  300.      self at: #ICONDRAWA_Frameless            put: 16r80009046.
  301.  
  302.      " Erase the background before drawing a frameless icon (Boolean). "
  303.      self at: #ICONDRAWA_EraseBackground      put: 16r80009047.
  304.  
  305.      " Draw the icon without the surrounding border and frame (Boolean). "
  306.      self at: #ICONDRAWA_Borderless           put: 16r80009053.
  307.  
  308.      " The icon to be drawn refers to a linked object (Boolean). "
  309.      self at: #ICONDRAWA_IsLink               put: 16r80009059.
  310.  
  311.      " Reserved tags; don't use: --------------------------------- "
  312.  
  313.      self at: #ICONA_Reserved1 put: 16r80009049.
  314.      self at: #ICONA_Reserved2 put: 16r8000904A.
  315.      self at: #ICONA_Reserved3 put: 16r8000904C.
  316.      self at: #ICONA_Reserved4 put: 16r80009051.
  317.      self at: #ICONA_Reserved5 put: 16r80009055.
  318.      self at: #ICONA_Reserved6 put: 16r80009056.
  319.      self at: #ICONA_Reserved7 put: 16r80009057.
  320.      self at: #ICONA_Reserved8 put: 16r80009058.
  321.  
  322.      self at: #ICONA_LAST_TAG  put: 16r80009059.
  323. |
  324.    privateSetup
  325.      (uniqueInstance isNil)
  326.        ifTrue: [uniqueInstance <- self privateNew.
  327.  
  328.                 self privateInitializeDictionary
  329.                ].
  330.                
  331.      ^ self    "or ^ uniqueInstance??"
  332. ]
  333.